package com.cj.handler;

import com.cj.service.impl.DemoProxyJDKImpl;
import org.omg.CORBA.SystemException;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.InvokeHandler;
import org.omg.CORBA.portable.OutputStream;
import org.omg.CORBA.portable.ResponseHandler;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author caojie
 * @version 1.0
 * @Description
 * @date 2023/7/24 18:04
 */
public class DemoProxyHandler implements InvocationHandler {

    private Object object;

    public DemoProxyHandler(Object object) {
        this.object = object;
    }

    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.printf("before");;

        Object invoke = method.invoke(object,args);
        System.out.printf("after");

        return invoke;
    }
}
